package com.taboa.nettest;

import java.util.ArrayList;
import java.util.List;

import com.taobao.remoting.Client;
import com.taobao.remoting.Remoting;
import com.taobao.remoting.RemotingException;
import com.taobao.remoting.RequestProcessor;
import com.taobao.remoting.Server;
import com.taobao.remoting.impl.RequestControlImpl;

public class ServerTest {

	private Server server;
	private UpdateCacheRequestProcessor updateCacheProcessor = new UpdateCacheRequestProcessor();

	void startServer() throws RemotingException {
		int port = 8990;
		String bindIp = null;

		List<RequestProcessor<?>> processors = new ArrayList<RequestProcessor<?>>();
		processors.add(updateCacheProcessor);

		server = Remoting.serverMgr().getServer(bindIp, port, null, processors);
		server.start();
	}

	public static void main(String[] args) throws Exception {
		ServerTest serverDemo = new ServerTest();
		serverDemo.startServer();
		System.out.println("Server start..............");
	}
}
